<template>
	<div class="main" ref='remove' style="height:100vh">
		<div class="univDetailWrap" style="height:100vh">
			<div class="back-wrapper whi flex-h">
				<div class="backboxs" v-show="showBackArrow"  @click="$router.back()">       
					<i class="imgIcon backimgs"></i>
					<span class="back">返回</span>
				</div>
				<div class="flex1"></div>
				<div class="backboxs right" @click="openShare">
					<img class="imgIcon" src="~/static/images/shareBlack.png" alt />
				</div>
			</div>
			<iframe  name = "child" id = "iframechild" :src="uri"
			frameborder="no" scrolling="auto"  width="100%" height="100%" style="overflow:hidden;width:105%" ></iframe>
		</div>
	</div>
</template>
<script>
	import { followUser, academyServiceDetail} from "~/api/colleges";
	import ls from 'store2';
	import { backAppOrWx } from "~/common/common";
	import { showShare } from "~/components/share/index";
	import wxapi from "~/plugins/wxapi.js";
	export default {
		components: {

		},
		data() {
			return {
				uri:'',
				showBackArrow:true
			}
		},
		methods: {
			openShare () {
				showShare("open");
			},
			wxShare(pic, titles, descs, id) {
				let uri  = window.location.href + "&shareIframe=" + true;			
				let option = {
					title: this.$route.query.shcoolname,
					desc: this.$route.query.feature,
					link: uri,
					imgUrl: this.$route.query.icon
				};

				wxapi.ShareAppMessage(option);
				wxapi.ShareTimeline(option);
    		},
			call(tel) {
			
			},
			goweb(website) {
				window.location.href = website

			},
			goback() {
				backAppOrWx();
			},
		},
		mounted: function() {	
			if (this.commonJs.GetUrlParam("shareIframe")) {
      			this.showBackArrow = false;
    		}	
			console.log('this.$route',this.$route);
			this.uri =  process.env.workUrl+'/remote-url?url=' + this.$route.query.web
			// this.uri = 'https://wap-test.shengxue985.sx985.com/remote-url?url=http://www.caa.edu.cn/index.html'
			this.$visit("iframebox")	
			wxapi.wxRegister()
			this.wxShare()
		},
		created(){	
		
		},
		beforeDestroy() {
		
		}
	}
</script>

<style scoped lang="less">
	.main{
		width: 7.5rem;
		height: 100vh;
		background: #fff;
		overflow: hidden;
	}
	.back-wrapper {
	width: 7.5rem;
	height: 0.8rem;
	line-height: 0.8rem;
	padding: 0 0.3rem;
	box-sizing: border-box;
	z-index: 10;
	background: #fff;
  .backboxs {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 1.2rem;
    height: 0.8rem;
    padding: 0.2rem 0;
  }

  .imgIcon {
    width: 0.4rem;
    height: 0.4rem;
  }
   .backimgs{
    display:inline-block;
    background: url('~@/static/sprite/icon_sprites_40.png') -0.1rem -0.1rem;
		background-size:3rem 2.4rem; 
   }
  .back {
    display: inline-block;
    margin-left: 0.1rem;
    font-weight: bold;
    color: #222;
  }
  .right {
    text-align: right;
    .imgIcon {
      margin-left: 0.8rem;
    }
  }
}
	#iframechild{
		width: 7.5rem;
		height: 100vh;
	}
	#iframechild::-webkit-scrollbar {
	    display: none
	}
</style>
